package com.glacier.yuyuan.config;


import com.glacier.yuyuan.common.interceptor.LogHandlerInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * date 2022-10-25 10:06
 * web配置
 *
 * @author glacier
 * @version 1.0
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LogHandlerInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/favicon.ico",
                        "/js/**",
                        "/css/**",
                        "/img/**",
                        "/plugins/**",
                        "/fonts/**",
                        "/webjars/**",
                        "/error");
    }
}
